namespace Core.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Category",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        CategoryCode = c.Int(nullable: false, identity: true),
                        Description = c.String(maxLength: 500),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Comment",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        MemberCode = c.Int(nullable: false, identity: true),
                        RequestCode = c.Int(nullable: false),
                        CommentCode = c.Int(nullable: false),
                        Description = c.String(maxLength: 500),
                        CreatingDate = c.DateTime(),
                        LastModified = c.DateTime(),
                        Active = c.Short(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Image",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        RequestCode = c.Int(nullable: false),
                        CreatingDate = c.DateTime(),
                        LastModified = c.DateTime(),
                        Url = c.String(maxLength: 500),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Member",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        MemberCode = c.Int(nullable: false, identity: true),
                        RoleCode = c.Int(),
                        Email = c.String(maxLength: 500),
                        Password = c.String(maxLength: 50),
                        Facebook = c.String(maxLength: 50),
                        Mobile = c.Int(),
                        Address = c.String(maxLength: 500),
                        Token = c.String(maxLength: 500),
                        DisplayName = c.String(maxLength: 50),
                        CreatingDate = c.DateTime(),
                        LastModified = c.DateTime(),
                        Active = c.Short(nullable: false),
                        Lock = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Request",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        RequestCode = c.Int(nullable: false, identity: true),
                        RequestType = c.String(maxLength: 1),
                        MemberCode = c.Int(nullable: false),
                        BookName = c.String(maxLength: 20),
                        CategoryCode = c.Int(nullable: false),
                        Description = c.String(),
                        Status = c.String(maxLength: 1),
                        Quantity = c.Int(),
                        Price1 = c.Decimal(precision: 18, scale: 2),
                        Price2 = c.Decimal(precision: 18, scale: 2),
                        Contact = c.String(maxLength: 500),
                        ExchangePlace = c.String(maxLength: 500),
                        Finished = c.Short(),
                        BookUrl = c.String(maxLength: 500),
                        CreatingDate = c.DateTime(),
                        LastModified = c.DateTime(),
                        Active = c.Short(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Role",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        RoleCode = c.Int(nullable: false),
                        Description = c.String(maxLength: 500),
                        Active = c.Short(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.Role");
            DropTable("dbo.Request");
            DropTable("dbo.Member");
            DropTable("dbo.Image");
            DropTable("dbo.Comment");
            DropTable("dbo.Category");
        }
    }
}
